package com.xyw.code.platform.webapps.rest;


import com.xyw.code.common.core.entity.vo.Result;
import com.xyw.code.platform.webapps.service.ISysLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 系统日志 前端控制器
 * </p>
 *
 * @author xyw
 * @since 2020-02-07
 */
@RestController
@RequestMapping("/sysLog")
public class SysLogController {

    @Autowired
    private ISysLogService logService;

    /**
     * 日志集合
     * @param page
     * @return
     */
    @GetMapping("/query")
    @ApiOperation(value = "日志集合",notes = "日志集合")
    public Result query(Integer page, Integer pageSize, Integer type, String userName, String description) {
        return Result.success(logService.query(page, pageSize,type,userName,description));
    }

    /**
     * 删除日志
     * @param ids
     * @return
     */
    @DeleteMapping("/delete")
    @ApiOperation(value = "删除日志",notes = "删除日志")
    public Result delete(@RequestBody List<String> ids) {
        return Result.success(logService.deleteByIds(ids));
    }

}

